<template>
	<view class="container">
		<view>
			<desc-wrapper :title="title" :desc="desc"></desc-wrapper>

			<z-card title="基本信息">
				<block v-if="resp">
					<view class="card-content-item">
						<text class="shrink-0 card-content-label_left">您掷出的随机数:</text>
						<text class="card-content_right card-text-red">{{ resp.number }}</text>
					</view>
					<view class="card-content-item">

						<text class="shrink-0 card-content-label_left">卦名:</text>
						<text class="card-content_right card-text-red">{{ resp.guaming }}</text>

					</view>
					<view class="card-content-item">

						<text class="shrink-0 card-content-label_left">吉凶：</text>
						<text class="card-content_right">{{resp.description.凶吉 }}</text>
					</view>
					<view class="card-content-item">

						<text class="shrink-0 card-content-label_left">卦曰：</text>
						<text class="card-content_right">{{ resp.description.卦曰 }}</text>

					</view>
					<view class="card-content-item">

						<text class="shrink-0 card-content-label_left">解曰：</text>
						<text class="card-content_right">{{ resp.description.解曰 }}</text>

					</view>
				</block>
			</z-card>

			<z-card title="解卦信息">
				<block v-if="resp">
					<view class="card-content-item">

						<text class="shrink-0 card-content-label_left">运势:</text>
						<text class="card-content_right">{{ resp.description.运势 }}</text>

					</view>
					<view class="card-content-item">

						<text class="shrink-0 card-content-label_left">财富:</text>
						<text class="card-content_right">{{ resp.description.财富 }}</text>

					</view>
					<view class="card-content-item">

						<text class="shrink-0 card-content-label_left">感情：</text>
						<text class="card-content_right">{{ resp.description.感情 }}</text>

					</view>
					<view class="card-content-item">

						<text class="shrink-0 card-content-label_left">事业：</text>
						<text class="card-content_right">{{ resp.description.事业 }}</text>
					</view>
					<view class="card-content-item">
						<text class="shrink-0 card-content-label_left">身体：</text>
						<text class="card-content_right">{{ resp.description.身体 }}</text>
					</view>
					<view class="card-content-item">
						<text class="shrink-0 card-content-label_left">神鬼：</text>
						<text class="card-content_right">{{ resp.description.神鬼 }}</text>
					</view>
					<view class="card-content-item">

						<text class="shrink-0 card-content-label_left">行人：</text>
						<text class="card-content_right">{{ resp.description.行人 }}</text>

					</view>
				</block>
			</z-card>
			<view class="bottom-btns" style="transform: translateY(-100%);" @click="todashi">
				<view class="start-btn">
					<text>大师详解</text>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				title: '每日一占结果分析',
				desc: '结果分析：心诚则灵，测算结果仅供参考。',
				resp: null
			}
		},
		onLoad(opt) {
			const that = this
			uni.request({
				url: 'https://cs.appzdm.com:3000/Zhanbu/meiri',
				method: 'POST',
				header: {
					'Content-Type': 'application/x-www-form-urlencoded'
				},
				data: {},
				success: (res) => {
					that.resp = res.data.data
				},
				fail: (error) => {
					console.error('Request Failed:', error)
				}
			})
		},
		methods:{
			todashi(){
				uni.switchTab({
					url:'/pages/tabbar/service'
				})
			}
		}
	}
</script>
<style lang="scss"></style>